/*
 * WantToBuyDetailGoodsListItem.java
 * business
 *
 * Created by ChenTao on 2017/5/26.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.app.Activity;
import android.content.Context;
import android.view.View;

import com.yidiandao.business.data.bean.Goods;
import com.yidiandao.business.ui.goodsdetail.GoodsDetailActivity;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.WantToBuyDetailGoodsHolder;

/**
 * 发现-求购详情-类似商品信息-ListItem
 * <p>
 * Created by ChenTao(chentao7v@gmail.com) on 2017-05-26 14:05
 */
public class WantToBuyDetailGoodsListItem extends DisplayListItem<WantToBuyDetailGoodsHolder, Goods> {

    public WantToBuyDetailGoodsListItem(Goods goods) {
        super(goods);
    }

    @Override
    public void onShow(final Context context, WantToBuyDetailGoodsHolder holder) {
        holder.refreshUI(data);
        holder.root.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                GoodsDetailActivity.actionStart((Activity) context, data.getGoodsId());
            }
        });
    }

    @Override
    public String getDisplayItemTag() {
        return WantToBuyDetailGoodsListItem.class.getSimpleName();
    }

    @Override
    public Class<WantToBuyDetailGoodsHolder> getViewHolderClazz() {
        return WantToBuyDetailGoodsHolder.class;
    }
}
